-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Final borrow #912
Final borrow #912
Conversation
7de8c30
to
90034f1
Compare
Some tests had their source (
|
Good ! First, CI is failing, which is indicating some of the sessions need to be updated. And indeed, it says that the iter_mut session is obsolete. Could you please update it?
This is suspicious. Why is this necessary? It should be equivalent, right?
I confirm that this is OK. This dates from the time where we had an assertion that we needed to prove the invariant. This assertion disappeared, so we can remove this hack. That being being said, this is a real problem: we may need a way to reliably delay resolution without breaking final reborrows... |
Let's not complicate an already complicated change with hypothetical edge-cases. The day when this becomes necessary we can revisit it. |
That's really weird, if this is breaking it also would indicate deeper issues to me. since |
Yes, of course! I was mentioning this simply because we may need to do something at some point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All in all I think this is very good news and should be merged quickly. Thanks.
There are still quite a few changes needed. Namely:
- First, I think there are a few bugs which I detailed in the review.
- Cleanup sessions. A few sessions contains "timeout" entries for some provers. They should not be included for successful goals (Why3 shows a warning for them, I think)
- The iter_mut test has an obsolete session. The new shapes file should be comitted.
- Some session files contains duplicate provers used for the same goals. This is not really a problem here, but it slows down the CI, so you should be cautious about them, and identify what part of your workflow with Why3IDE makes these duplicated prover calls.
- Not all changes to iter_mut and take_first_mut have been propagated to
creusot_contracts
. - @xldenis have merged Allow logically reborrowing through derefs of ghost and indexing things #852, so you should resolve the conflicts, and add reborrowing of indexed projections
I'm sorry to ask you these changes, but you're almost there!
Actually it does not imply this, because @arnaudgolfouse's version does not say anything about the inner tag. And I think @arnaudgolfouse is right: his change is necessary because of the change of the specification of That being said, |
1ecf9ed
to
4678ee2
Compare
4678ee2
to
4b3d179
Compare
fc85e96
to
d5333ab
Compare
This is functionally the same, but it helps why3 to detect that the `final` field does not change on reborrows.
This is not necessary, because a reborrow `y = &mut *x` is translated as ``` y <- Borrow.borrow_mut (* x) x <- { x with current = (^ y) } ``` And `Borrow.borrow_mut` already creates a fresh address.
d5333ab
to
18bae16
Compare
This should be good to go |
Could you please do a pass on each of my comments, check you have indeed handle them, and mark them as resolved? Thanks ! |
18bae16
to
4f9c38e
Compare
4f9c38e
to
d0c5bae
Compare
d0c5bae
to
7adfb17
Compare
Experiment to repair proofs when using a third field in mutable borrows.
In short, in the following code:
Then:
ref_x_1
andref_x_2
should be the same, becauseref_x_1
is "dead" after the reborrow (we say that this reborrow is final)ref_y_1
, so the third field ofref_y_1
andref_y_2
is not the same.